FROM openjdk:8-jre-alpine

LABEL maintainer="tan.yi1993@163.com" \
    description="基于java1.8，用于运行公积金项目"

WORKDIR /root/

RUN mkdir /root/config && \
    mkdir /root/config/core && \
    mkdir /root/config/service && \
    mkdir /root/config/service/configuration

ENV LANG=en_US.UTF-8 HOUSINGFUND_CONF_DIR=/root/config/core/

#将jar打包到镜像中（将本文件拷贝到相应工程根目录）
COPY target/housing-network*.jar /root/jar/app.jar
COPY elastic-apm-agent-0.7.0.jar /root/jar/apmagent.jar


ENTRYPOINT java -Xbootclasspath/a:/root/config/service \
    -javaagent:/root/jar/apmagent.jar -Delastic.apm.service_name=${APPNAME} -Delastic.apm.server_urls=${APMURL} -Delastic.apm.application_packages=${PACKAGE} \
    -jar /root/jar/app.jar
